﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DLMemberPointMS.Entity.ViewModel;
using DLMemberPointMS.Business;
using DLMemberPointMS.Common;
namespace DLMemberPointMS.Web.Controllers
{
    public class CountSumController : Controller
    {
        private CountGirfSerives Card = new CountGirfSerives();
        // GET: CountSum
        public ActionResult Index()
        {
            return View();
        }
        /// <summary>
        /// 礼品兑换
        /// </summary>
        /// <returns></returns>
        public ActionResult GiftIntegralView()
        {
            return View();
        }

        public ActionResult GetGiftIntegralView(GirfCountView viewmodel)
        {

            return Json(Card.GetCardlevels(viewmodel), JsonRequestBehavior.AllowGet);
        }
        /// <summary>
        /// 减积分
        /// </summary>
        /// <returns></returns>
        public ActionResult JianJiFenGridlView()
        {

            var model =EnumHelper.EnumListDic<CardLevelsEnum>("", "0");
            var list = new SelectList(model, "value", "key");
            ViewBag.CardLevelId = list;


            return View();
        }

        public ActionResult GetJianJiFenGridlView(JianJiFenMemberViewModel viewModel)
        {
            //return View();

            ConsumeOrdersService consum = new ConsumeOrdersService();
            return Json(consum.GetJianJifen(viewModel), JsonRequestBehavior.AllowGet);

        }
        /// <summary>
        /// 积分返现
        /// </summary>
        /// <returns></returns>
        public ActionResult FanxianGridlView()
        {
            //枚举类型 绑定下拉列表
            var model = EnumHelper.EnumListDic<CardLevelsEnum>("", "0");
            var list = new SelectList(model, "value", "key");
            ViewBag.CardLevelId = list;

            return View();
        }

        public ActionResult GetFanxianiFenGridlView(JianJiFenMemberViewModel viewModel)
        {
            //return View();
            ConsumeOrdersService consum = new ConsumeOrdersService();
            return Json(consum.GetJiFenFanXian(viewModel), JsonRequestBehavior.AllowGet);

        }

        /// <summary>
        /// 快速消费统计
        /// </summary>
        /// <returns></returns>
        public ActionResult FastconsumeGridlView()
        {
            //枚举类型 绑定下拉列表
            var model = EnumHelper.EnumListDic<CardLevelsEnum>("", "0");
            var list = new SelectList(model, "value", "key");
            ViewBag.CardLevelId = list;
            return View();
        }
        public ActionResult GetFastconsumeGridlView(JianJiFenMemberViewModel viewModel)
        {
            //return View();
            ConsumeOrdersService consum = new ConsumeOrdersService();
            return Json(consum.GetFastJifen(viewModel), JsonRequestBehavior.AllowGet);
        }
        /// <summary>
        /// 会员消费情况统计
        /// </summary>
        /// <returns></returns>
        public ActionResult MemConsumGridlView()
        {
            //枚举类型 绑定下拉列表
            var model = EnumHelper.EnumListDic<orderTypeEnum>("", "0");
            var list = new SelectList(model, "value", "key");
            ViewBag.CardLevelId = list;

            return View();
        }
        public ActionResult GetMemConsumGridlView(JianJiFenMemberViewModel viewModel)
        {
            //return View();
            ConsumeOrdersService consum = new ConsumeOrdersService();
            return Json(consum.GetMemConsun(viewModel), JsonRequestBehavior.AllowGet);

        }




    }
}